<?php
use Workerman\Worker;

require __DIR__ . '/vendor/autoload.php';

use Workerman\Crontab\Crontab;

$worker = new Worker();

// 设置时区，避免运行结果与预期不一致
date_default_timezone_set('PRC');

$worker->onWorkerStart = function () {
    // 每分钟的第1秒执行.
    new Crontab('1 * * * * *', function () {
        echo 'test.php echo time => ' . date('Y-m-d H:i:s') . "\n";
    });
};

Worker::runAll();